package com.wwwzh.himalayafm.adapter.live_adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.util.Log;

import com.wwwzh.himalayafm.entity.entity_broadtwo.ProResult;
import com.wwwzh.himalayafm.fragment.disfragment.recommend.PageLiveFragment;

import java.util.List;

/**
 * Created by wuruyuan on 2016/12/8.
 */

public class BroadPageAdapter extends FragmentPagerAdapter{
    private List<ProResult> list;

    public BroadPageAdapter(FragmentManager fm, List<ProResult> list) {
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {
        return PageLiveFragment.getInstance(list.get(position).getProvinceCode());
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        Log.d("22222", "getItem: "+list.get(0).getProvinceName());
        return list.get(position).getProvinceName();
    }
}
